/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ProblemInTrial;

//102 
import java.io.File;
import java.io.FileInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.StringTokenizer;

/**
 *
 * @author InspireServe
 */
class Main {
    
    //b g c
    public static int[] inputArray = new int[9];
    public static int[][] BCG = new int[3][3];
    public static HashMap<Integer, String> numberToBin= new HashMap<Integer, String>();
    public static String[] combinations = {"BCG", "BGC",
        "CBG", "CGB",
        "GBC", "GCB"};  
     
   
    
    //public static void main(String args[]) throws FileNotFoundException{
    public static void main(String args[]) throws IOException{
        //initializing data structure needed
        //test();
        //initialize();
        run();
    }//end of main
    
    //public static void run()throws FileNotFoundException{
    public static void run() throws IOException{
        //take input
        //Scanner lineReader = new Scanner(System.in);
        //BufferedReader lineReader = new BufferedReader(new InputStreamReader(new FileInputStream(new File("input.txt"))));
        BufferedReader lineReader = new BufferedReader(new InputStreamReader(System.in));
        //Scanner lineReader = new Scanner(new File("input.txt"));
        //Scanner valueReader;
        StringTokenizer valueReader;
        String line;
        while (true) {
            line = lineReader.readLine();
            if(line == null){
                break;
            }
            valueReader = new StringTokenizer(line);
            for(int i =0; i < 9; i++){
                inputArray[i] = Integer.parseInt(valueReader.nextToken());
            }//end for
            
            //fill the 3 x 3 matrix, BCG
            /*
            for(int i = 0 ; i < 3; i++){
                for(int j = 0; j < 3; j++){
                    int tempIndex = 3 * j + 1;
                    BCG[i][j] = inputArray[tempIndex] + inputArray[tempIndex + 1];
                }//end inner for
            }//end outer for
            */
            
            for(int i = 0; i < 3; i++){
                //filling 0 row
                //b
                int tempIndex = i * 3;
                BCG[0][i] = inputArray[tempIndex + 1] + inputArray[tempIndex + 2];
                
                //filling 1 row
                //g
                tempIndex += 1;
                BCG[2][i] = inputArray[tempIndex - 1] + inputArray[tempIndex + 1];
                
                //filling 2 row
                //c
                tempIndex += 1;
                BCG[1][i] = inputArray[tempIndex - 1] + inputArray[tempIndex - 2];
            }//end for
            
            
            inputArray[0] = BCG[0][0] + BCG[1][1] + BCG[2][2];
            inputArray[1] = BCG[0][0] + BCG[2][1] + BCG[1][2];
            
            inputArray[2] = BCG[1][0] + BCG[0][1] + BCG[2][2];
            inputArray[3] = BCG[1][0] + BCG[2][1] + BCG[0][2];
            
            inputArray[4] = BCG[2][0] + BCG[0][1] + BCG[1][2];
            inputArray[5] = BCG[2][0] + BCG[1][1] + BCG[0][2];
            
            /*
            for(int i = 0; i < 3; i++){
                int j = (3 + i + 1) % 3;
                int k = (3 + i - 1) % 3;
                inputArray[2 * i] =     BCG[i][0] + BCG[k][1] + BCG[j][2];
                inputArray[2 * i + 1] = BCG[i][0] + BCG[j][1] + BCG[k][2];
            
            }//end for
            */
            
            int min = Integer.MAX_VALUE;
            int minIndex = -1;
            for(int i = 0; i < 6; i++){
                if(inputArray[i] < min){
                    min = inputArray[i];
                    minIndex = i;
                }
            }//end for 
            printf(combinations[minIndex] + " " + inputArray[minIndex]);

        }//end while
        
        /*
         int numberOfTestCases = Integer.parseInt(lineReader.readLine());
         for(int i = 0; i < numberOfTestCases; i++){
        
         }//end for
         */
    }//end of run
    
    public static void test(){
    
    }//end of test
    
    public static void printf(String str){
        System.out.println(str);
    }//end of printf
}//end of class
